﻿using _5E.Infrastructure.UnitOfWork;
using NHibernate;
using NHibernate.Criterion;
using WholesaleOnline.Model;

namespace WholesaleOnline.Repository
{
    public class BuyerNotOrderProductRepository : BuyerProductRepository
    {
        public BuyerNotOrderProductRepository(IUnitOfWork uow) : base(uow) { }

        protected override void AppendFindProductsQueryOver(IQueryOver<WoBuyerProduct, WoBuyerProduct> queryOver)
        {
            queryOver.Where(b => b.IsOrder == false);
        }

        protected override void AppendFindCategoryIdsConjunction(NHibernate.Criterion.Conjunction andSubQuery)
        {
            andSubQuery.Add(Restrictions.Eq("b.IsOrder", false));
        }
    }
}
